#lang scheme
(define largest 0)
(define n 600851475143)
(define sqrtn (sqrt n))
(define (lpf num)
	(if (= (modulo n num) 0) (if (> num largest) (set! largest num) (set! largest largest)) (set! n (/ n num)))
	(set! num (+ num 1)) 
	(if (< num sqrtn) (lpf num) (largest)))

(print (lpf 2))